/**
 * 
 */
package puzzlegame.application;

import java.io.IOException;

import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Image;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;
import javax.microedition.lcdui.*;

import puzzlegame.presentation.*;

/**
 * @author Ma811
 * 
 */
public class PuzzleGameApp extends MIDlet implements CommandListener
{
	PuzzleCanvas gameCanvas;
	MyPauseCanvas pauseCanvas;
	
	// Menu commands
	Command exitCmd;
	/*
	 * (non-Javadoc)
	 * 
	 * @see javax.microedition.midlet.MIDlet#destroyApp(boolean)
	 */
	protected void destroyApp(boolean arg0) throws MIDletStateChangeException
	{
		// TODO Auto-generated method stub

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see javax.microedition.midlet.MIDlet#pauseApp()
	 */
	protected void pauseApp()
	{
		// TODO Auto-generated method stub

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see javax.microedition.midlet.MIDlet#startApp()
	 */
	protected void startApp() throws MIDletStateChangeException
	{
		// TODO Auto-generated method stub
		// pauseCanvas = new MyPauseCanvas();
	
		try
		{
			gameCanvas = new PuzzleCanvas(false);
		}
		catch (IOException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		// Create commands
		exitCmd = new Command("Exit", Command.EXIT, 1);
		
		gameCanvas.addCommand(exitCmd);
		
		gameCanvas.setCommandListener(this);
		
		Display.getDisplay(this).setCurrent(gameCanvas);
		
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * javax.microedition.lcdui.CommandListener#commandAction(javax.microedition
	 * .lcdui.Command, javax.microedition.lcdui.Displayable)
	 */
	public void commandAction(Command arg0, Displayable arg1)
	{
		// TODO Auto-generated method stub

	}
	
	public void OnNewGame()
	{
	
	}

}
